﻿@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <meta charset="utf-8">
    <title>计划兑现率</title>
    <link href="~/Scripts/jquery-easyui/themes/bootstrap/easyui.css" rel="stylesheet" />
    <script src="~/Scripts/jquery-easyui/jquery.min.js"></script>
    <script src="~/Scripts/jquery-easyui/jquery.easyui.min.js"></script>
    <script src="~/Scripts/jquery-easyui/locale/easyui-lang-zh_CN.js"></script>
    <link href="~/Content/themes/icon.css" rel="stylesheet" />
    <script src="~/Content/js/common.js?v=8.8"></script>
    <link href="~/Content/themes/table.css" rel="stylesheet" />
    <script src="~/Scripts/echarts.js"></script>
    <script type="text/javascript">

        function toPercent(point) {
            var str = Number(point * 100).toFixed(1);
            str += "%";
            return str;
        }

        $(function () {

            $.ajax({     //请求当前用户可以操作的按钮
                url: "/Produce/getFBillFinishRate?r=" + Math.random(),
                type: "post",
                data: { "KeyCode": " ", "KeyName": " ","yearID":2020},
                dataType: "json",
                timeout: 5000,
                success: function (data) {
                    $("#resultdiv").empty();
                    var strHtml = "";
                    $.each(data.rows,function(InfoIndex,Info){
                        if (Info.Id == 0) {
                            strHtml += "本年度至今总数：" + Info.billcount + "，已兑现订单数：" + Info.finished + "，计划兑现率：" + toPercent(Info.rate) + "<hr><hr>";
                        } else {
                            strHtml += Info.Id + "月订单总数：" + Info.billcount + "，已兑现订单数：" + Info.finished + "，计划兑现率：" + toPercent(Info.rate) + "<hr>";
                        }  
                    })
                  
                    $("#resultdiv").html(strHtml + "<hr>说明：计划兑现率计算不包括类型为加急(68)的订单。");
                    
                },
                error: function (XMLHttpRequest, textStatus, errorThrown) {
                    if (textStatus == "timeout") {
                        $.show_alert("提示", "请求超时，请刷新当前页重试！");
                    }
                    else {
                        $.show_alert("错误", textStatus + "：" + errorThrown);
                    }
                }
            })


        })

    </script>

</head>
<body>
    <div id="ui_user_layout" class="easyui-layout" data-options="fit:true,border:false">

        <div data-options="region:'center',border:false">
            
            <div id="resultdiv" class="easyui-panel" title="计划兑现率"
                 style="width:auto;height:auto;padding:15px;background:#fafafa;"
                 data-options=" ">
                计划兑现率查询中......

            </div>
            
 

        </div>

        <div data-options="region:'south',border:false">
          
        </div>
    </div>
   

</body>
</html>
